projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b820c95
)
Fix memory leakage with GPX/XML extension tags
author
alexmot
<alexmot>
Mon, 15 Sep 2003 13:05:09 +0000
(13:05 +0000)
committer
alexmot
<alexmot>
Mon, 15 Sep 2003 13:05:09 +0000
(13:05 +0000)
gpx.c
patch
|
blob
|
history
diff --git
a/gpx.c
b/gpx.c
index f9d82ba277a54d5a6039a1435e307465bb03cea5..62c67b2fdb4384295d694efc1808a27ee9089776 100644
(file)
--- a/
gpx.c
+++ b/
gpx.c
@@
-915,6
+915,8
@@
fprint_xml_chain( xml_tag *tag, const waypoint *wpt )
void free_gpx_extras( xml_tag *tag )
{
xml_tag *next = NULL;
+ char **ap;
+
while ( tag ) {
if (tag->cdata) {
xfree(tag->cdata);
@@
-929,8
+931,14
@@
void free_gpx_extras( xml_tag *tag )
xfree(tag->tagname);
}
if (tag->attributes) {
- xfree(tag->attributes);
+ ap = tag->attributes;
+
+ while (*ap)
+ xfree(*ap++);
+
+ xfree(tag->attributes);
}
+
next = tag->sibling;
xfree(tag);
tag = next;